package com.gxa.modules.worktable.service.impl;

import com.gxa.modules.worktable.entity.Journals;
import com.gxa.modules.worktable.entity.RepairAmount;
import com.gxa.modules.worktable.mapper.JournalMapper;
import com.gxa.modules.worktable.service.JournalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class JournalServiceImpl implements JournalService {
    @Autowired
    private JournalMapper journalMapper;

    @Override
    public Journals queryHouseHoldTotal() {
        Journals journals = new Journals();
        int houseHoldTotal = this.journalMapper.queryHouseHoldTotal();
        int houseTotal = this.journalMapper.queryHouseTotal();
        int equipmentTotal = this.journalMapper.queryEquipmentTotal();
        int parkingSpaceTotal = this.journalMapper.queryParkingSpaceTotal();

        journals.setHouseHoldTotal(houseHoldTotal);
        journals.setHouseTotal(houseTotal);
        journals.setEquipmentTotal(equipmentTotal);
        journals.setParkingSpaceTotal(parkingSpaceTotal);

        return journals;
    }

    @Override
    public List<RepairAmount> queryRepair() {
        List<RepairAmount> repairAmounts =this.journalMapper.queryRepair();
        return repairAmounts;
    }
}
